package com.szxy.cart.service;

import com.szxy.utils.Result;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Auther:zwer
 * @Date:2019/9/12 10:12
 * @Description:com.szxy.cart.service
 * @Version:1.0
 **/
public interface CookieCartService {

    /**
     * 将商品到购物车，并存放在 Cookie 中
     * @param itemId
     * @param num
     * @param request
     * @param response
     * @return
     */
    Result addItem(Long itemId, Integer num, HttpServletRequest request, HttpServletResponse response);

    /**
     * 展示购物车中商品
     * @param request
     * @param response
     * @return
     */
    Result showCart(HttpServletRequest request, HttpServletResponse response);

    /**
     * 更新购物车信息
     * @param itemId
     * @param num
     * @param request
     * @param response
     * @return
     */
    Result updateItemNum(Long itemId, Integer num, HttpServletRequest request, HttpServletResponse response);

    /**
     * 删除购物车信息
     * @param itemId
     * @param request
     * @param response
     * @return
     */
    Result deleteItemFromCart(Long itemId, HttpServletRequest request, HttpServletResponse response);

}
